package com.mobi.Survey.lib.model;

import android.content.Context;

import com.mobi.Survey.lib.db.FavoriteTable;

public class FavoritePojo extends Pojo {

	private long id;
	private String userId;
	private long surveyId;;
	private String description;
	private String iconUrl;
	//private Bitmap iconBitmap;



	private boolean autoLoad;
	private boolean favorite;

	public boolean isAutoLoad() {
		return autoLoad;
	}

	public void setAutoLoad(boolean autoLoad) {
		this.autoLoad = autoLoad;
	}

	public boolean isFavorite() {
		return favorite;
	}

	public void setFavorite(boolean favorite) {
		this.favorite = favorite;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	public long getSurveyId() {
		return surveyId;
	}

	public void setSurveyId(long surveyId) {
		this.surveyId = surveyId;
	}

	public static void deleteBySurveyId(Context ctx, long surveyId) {
		FavoriteTable table = new FavoriteTable(ctx);
		table.deleteRow(surveyId);
		table.closeDB();
	}
//	public Bitmap getIconBitmap() {
//		return iconBitmap;
//	}
//
//	public void setIconBitmap(Bitmap iconBitmap) {
//		this.iconBitmap = iconBitmap;
//	}
	public static void commit(Context ctx, FavoritePojo pojo) {

		FavoriteTable table = new FavoriteTable(ctx);
		table.insertRow(pojo);
		table.closeDB();

	}

}
